package com.example.miuicolorpick

import android.graphics.Color
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.TextView

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        val miColorView =  findViewById<MiColorPickView>(R.id.miColorView)
        val tvTip = findViewById<TextView>(R.id.tvTip)
        miColorView.miColorView = object : MiColorView {
            override fun onBottomColorClick(colorStr: String) {
                tvTip.text = colorStr
                tvTip.setBackgroundColor(Color.parseColor(colorStr))
            }

            override fun onColorSelect(colorStr: String) {

            }
        }
    }
}